﻿using CNKI.TPI.Web.Search.Model;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;

namespace CNKI.TPI.Web.Search.IBLL
{
    /// <summary>
    /// 
    /// </summary>
    public interface ISubmitService
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="Flag"></param>
        /// <returns></returns>
        IList<SYS_CMS_OPTION> GetSubmitDBList(int Flag);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="dbCode"></param>
        /// <returns></returns>
        IList<SYS_CMS_SUBMIT> GetSubmitConfig(string dbCode);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="strDbCode"></param>
        /// <param name="sysid"></param>
        /// <param name="strField"></param>
        /// <param name="strFieldValue"></param>
        /// <returns></returns>
        bool IsOnlyOne(string strDbCode, int sysid, string strField, string strFieldValue);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="dbCode"></param>
        /// <param name="fieldname"></param>
        /// <param name="fieldType"></param>
        /// <returns></returns>
        SYS_CMS_SUBMIT GetSubmitConfig(string dbCode, string fieldname, SubmitFieldType fieldType);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="dbcode"></param>
        /// <returns></returns>
        string GetPYHZList(string dbcode);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="sql"></param>
        /// <returns></returns>
        DataTable ExecuteSql(string sql);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="dbID"></param>
        /// <param name="sysid"></param>
        /// <param name="fieldList"></param>
        /// <returns></returns>
        DataTable GetMetaData(int dbID, int sysid, string fieldList);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="sysid"></param>
        /// <param name="dbcode"></param>
        /// <param name="fileName"></param>
        /// <returns></returns>
        bool CheckFileExsit(int sysid, string dbcode, string fileName);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="dbcode"></param>
        /// <param name="filename"></param>
        /// <param name="digitfilename"></param>
        /// <param name="sysid"></param>
        /// <param name="result"></param>
        /// <param name="strSavePath"></param>
        /// <returns></returns>
        string DeleteFileInfo(string dbcode, string filename, string digitfilename, int sysid, string result, string strSavePath);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="dbcode"></param>
        /// <param name="isUnicode"></param>
        /// <param name="nInsertRows"></param>
        /// <param name="resorceType"></param>
        /// <param name="contentType"></param>
        /// <param name="readOnline"></param>
        /// <param name="contentFlag"></param>
        /// <param name="filename"></param>
        /// <param name="filesize"></param>
        /// <param name="fileformat"></param>
        /// <param name="filepath"></param>
        /// <param name="digitfilename"></param>
        /// <param name="flag"></param>
        /// <returns></returns>
        int ProcessMetaDataFile(string dbcode, bool isUnicode, int nInsertRows, string resorceType, int contentType, int readOnline, int contentFlag, string filename, string filesize, string fileformat, string filepath, string digitfilename, int flag);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="dbcode"></param>
        /// <param name="oldRecID"></param>
        /// <param name="newRecID"></param>
        /// <returns></returns>
        int UpdateMetaFileLink(string dbcode, int oldRecID, int newRecID);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="sql"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="count"></param>
        /// <returns></returns>
        DataTable GetDataBySql(string sql, int pageIndex, int pageSize, out int count);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="file"></param>
        /// <param name="filePath"></param>
        /// <returns></returns>
        bool SaveFile(HttpPostedFile file, string filePath);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="filePath"></param>
        /// <returns></returns>
        bool DeleteFile(string filePath);
    }
}
